<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style" />
	<meta content="telephone=no" name="format-detection" />
	<meta name="description" />
	<link rel="icon" href="/favicon.ico" type="image/x-icon" />
	<title>经销商分润管理系统</title> 

   	<link href="__CSS__/mui.min.css" rel="stylesheet"> 
    <link href="__CSS__/alertify.core.css" rel="stylesheet" type="text/css">
    <link href="__CSS__/alertify.default.css" rel="stylesheet" type="text/css">
    <link href="__CSS__/font-awesome.min.css" rel="stylesheet" /> 
	<link href="__CSS__/default.manager.css" rel="stylesheet" type="text/css" />
 	<link href="__CSS__/app.css" rel="stylesheet"/> 
    <link href="__CSS__/SkinConfig-Black.css" rel="stylesheet"  type="text/css"/> 
    <link href="__CSS__/user.css" rel="stylesheet"> 
    
    <script type="text/javascript" src="__JS__/jquery.2.1.4.min.js"></script>
   	<script type="text/javascript" src="__JS__/mtcache/mt.cache.js"></script>
   	<script type="text/javascript" src="__JS__/vue.min.js"></script>   
    <script type="text/javascript" src="__JS__/lib/alertify.js"></script> 
	<script type="text/javascript" src="__JS__/lib/jquery.qrcode.min.js"></script>  
    <script type="text/javascript" src="__JS__/lib/exif.js"></script> 
    <script type="text/javascript" src="__JS__/lib/mobileFix.mini.js"></script> 
    <script type="text/javascript" src="__JS__/mt.compress-1.1.js"></script> 
    <script type="text/javascript" src="__JS__/mui.min.js"></script>
    <script type="text/javascript" src="__JS__/LUploader.js?v=1.0.0"></script>
	<style type="text/css">
	.mui-input-group input{
		height: 40px; 
	}
	.zpsc{
		text-align: center; 
	}
	.zpsc img{
		width: 5rem;
    	margin-top: 0.3rem; 
	}
	.zpsc h3{
		text-align: center;
    	font-size: 14px;
    	font-weight: normal;
    	margin-top:0;
    	margin-bottom:0.5rem;
	}
	.zpsc .mui-col-sm-6{
		width:50%;
	}
	.mui-input-group .mui-input-row:after{
		left: 0;
	}
	.icon-camera{background-image:url("__IMG__/paizhao.png");background-size:100%}
	.LUploader{
		margin:20px 15px 15px 15px;
		padding: 5px;
	    text-align: center;  
	    background: #ffffff;
	    height: 100px;
	    position: relative;
	    width: 50%;
	    float: left;
	    box-sizing: border-box;
	    margin: 0;
	}
	.LUploader input[data-LUploader]{display:none}
	.LUploader .icon{font-size:20px;margin:1.5rem auto 5px auto;width:1em;height:1em;display:block}
	.LUploader p{padding:0 0 20px 0;font-size:13px;color:#afb1b4}
	.LUploader .LUploader-container{height:100%}
	.LUploader .LUploader-container+div{position:absolute;top:0;left:0;width:100%;height:100%}
	.LUploader .LUploader-list{
		height:100%;    
		padding: 0;
    	margin: 0;
    }.LUploader .LUploader-list li{position:relative;display:inline-block;width:100%;height:100%;background:#fff no-repeat center;background-size:cover}.LUploader .LUploader-progress{position:absolute;width:100%;height:20px;line-height:20px;bottom:0;left:0;background-color:rgba(100,149,198,0.5)}.LUploader .LUploader-progress span{display:block;width:0;height:100%;background-color:#6495c6;text-align:center;color:#FFF;font-size:13px}.LUploader .LUploader-size{position:absolute;width:100%;height:15px;line-height:15px;bottom:-18px;text-align:center;font-size:13px;color:#666}
	 
	.mui-input-group:after{
		content:none;
	}
	</style>
 	<script>
		var ajaxCacheTime = 30;  
 	</script>
</head>
<body id="app" class="mui-android mui-android-6 mui-android-6-0 mui-fullscreen" style="text-size-adjust: 100%;">
	<header class="mui-bar mui-bar-nav ">
        <span class="mui-icon mui-icon-back mui-pull-left"></span>
        <h1 class="mui-title title">我要录单</h1> 
    </header>
     
    <nav class="mui-bar mui-bar-tab" style="background:#BF2D92;">
		 <p style="text-align:center;line-height:2.75rem;margin:0;" id="ljzc">确认</p>
	</nav>
	<div class="mui-content">   
		<form class="mui-input-group" id="reg_form" action="{:url()}" method="post">  
		    <div class="mui-input-row">
		        <label>姓名</label>
		        <input type="text" name="name" id="name" class="mui-input-clear" placeholder="姓名">
		    </div> 
		    <div class="mui-input-row">
		        <label>电话</label>
		        <input type="text" name="phone" id="phone" class="mui-input-clear" placeholder="电话">
		    </div> 
		    <div class="mui-input-row">
		        <label>公司名称</label>
		        <input type="text" name="gsmc" id="gsmc" class="mui-input-clear" placeholder="公司名称">
		    </div> 
		    <div class="mui-input-row">
		        <label>公司地址</label>
		        <input type="text" name="gsdz" id="gsdz" class="mui-input-clear" placeholder="公司地址">
		    </div> 
		</form>
	</div>
     
    <div id="jingle_popup_mask" style="opacity: 0.1; display: none;"></div> 
    
    <div style="display:none"> 
	   	<script>
	          setTimeout(function () { 
	              document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust = "100%";  
	           }, 2000);  
	    </script> 
    </div>  
</body> 
<script type="text/javascript">
$(function(){ 
	$(".mui-icon-back").click(function(){
    	history.go(-1);
    });
	$("#cggs").change(function(){
		var cggs = $(this).val();
		var danjia = $("#danjia").val();
		var zongjia = cggs*danjia;
		$("#zongjia").val(zongjia);
		$("#zongjia_txt").html(toDecimal2(zongjia));
	});
	//采购
	$("#ljzc").click(function(){
		var that = $(this);
		var _form = $("#reg_form");
		$.ajax({
            type: "POST",
            url: _form.attr('action'),
            data: _form.serialize(),
            success: function(res) {
            	if(res.code == 0){
            		mui.alert(res.msg);
            		return false;
            	}else{
            		mui.alert(res.msg, ' ', function() { 
            			window.top.location.href = "/index.php/index/user/";
            		});
            	}
                //console.log(res);
            }
        });
	});
});
 
[].slice.call(document.querySelectorAll('input[data-LUploader]')).forEach(function(el) {
    new LUploader(el, {
        url: "{:url('user/uploadImg')}",//post请求地址
        multiple: false,//是否一次上传多个文件 默认false
        maxsize: 102400,//忽略压缩操作的文件体积上限 默认100kb
        accept: 'image/*',//可上传的图片类型
        quality: 0.3,//压缩比 默认0.1  范围0.1-1.0 越小压缩率越大
        showsize:false//是否显示原始文件大小 默认false
    });
});

function NumberCheck(t){
    var num = t.value;
    var re=/^\d*$/;
    if(!re.test(num)){
        isNaN(parseInt(num))?t.value=0:t.value=parseInt(num);
    }
}
function toDecimal2(x) { 
	var f = parseFloat(x); 
	if (isNaN(f)) { 
		return false; 
	} 
	var f = Math.round(x*100)/100; 
	var s = f.toString(); 
	var rs = s.indexOf('.'); 
	if (rs < 0) { 
		rs = s.length; 
		s += '.'; 
	} 
	while (s.length <= rs + 2) { 
		s += '0'; 
	} 
	return s; 
}
</script> 
</html>